// 	HelloWorld.java
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.net.UnknownHostException;

import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.Socket;
import java.lang.Thread;

public class helloworld 
{
	public static void main(String args[]) 
	{
	try{
		//		String http_get = "GET /:8000 HTTP/1.1\n Host: www.163.com\n User-Agent: Mozilla/5.0 (X11; U; Linux i686; zh-CN; rv:1.9.2.10) Gecko/20101005 Fedora/3.6.10-1.fc14 Firefox/3.6.10 \n Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\n Accept-Language: zh-cn,zh;q=0.5 \n Accept-Encoding: gzip,deflate \n Accept-Charset: GB2312,utf-8;q=0.7,*;q=0.7 \n Keep-Alive: 115\n Connection: keep-alive\n   \n \n";
		String str = "GET /:8000 HTTP/1.1 ";

		while(true)
		{
			{
				Socket socket = new Socket("61.153.56.191",80);
				BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));
				BufferedReader reader = new BufferedReader(new InputStreamReader(socket.getInputStream()));
				writer.write(str);
				writer.flush();
				String txt="";
				String s = null;
				while((s=reader.readLine()) != null)txt += s;
				System.out.println("recv    + " + txt);
			}
			Thread.sleep(2000);
		}
		}
	catch(Exception ee)
		{
		}
	}
}
